package com.lfs.market.controller.front;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.lfs.market.model.R;
import com.lfs.market.service.AIChatService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lfs
 * @date 2025/5/11 01:13:43
 */
@RestController
@RequestMapping("/ai")
@SaCheckLogin
public class AIChatController {
    @Resource
    private AIChatService aiChatService;

    /**
     * 发布商品
     *
     * @param userMessage
     * @return
     */
    @GetMapping("/sendChat")
    public R sendChat(@RequestParam("userMessage") String userMessage) {
        String aiMessage = aiChatService.sendChat(userMessage);
        return R.ok(aiMessage);
    }
}
